<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>EditorInfo</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
<script language="javascript" src='../links.js' type="text/javascript"></script>
</head>
<body>

<h1>EditorInfo</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a  href="index.html">structures</a><br>
</div>

<div class=shortdescr>
The <dfn>EditorInfo</dfn> structure is used in the <a href="../service_functions/editorcontrol.html">EditorControl</a> function to get information
about the current FAR editor state.
</div>

<pre class=syntax>
struct EditorInfo
{
  int EditorID;
  const char *FileName;
  int WindowSizeX;
  int WindowSizeY;
  int TotalLines;
  int CurLine;
  int CurPos;
  int CurTabPos;
  int TopScreenLine;
  int LeftPos;
  int Overtype;
  int BlockType;
  int BlockStartLine;
  int AnsiMode;
  int TableNum;
  DWORD Options;
  int TabSize;
  int BookMarkCount;
  DWORD CurState;
  DWORD Reserved[6];
};
</pre>
<h3>Elements</h3>
<div class=descr>

    <div class=dfn>EditorID</div>
    <div class=dfndescr>Identifier of the editor instance. Each editor instance has a unique identifier during the lifetime of a FAR session.</div>
    <div class=dfn>FileName</div>
    <div class=dfndescr>Full path and name of the edited file <!-- (<em>but see <a href="../articles/ed_fullpath.html">notes for FAR versions below 1.65</a></em>) -->.</div>
    <div class=dfn>WindowSizeX, WindowSizeY</div>
    <div class=dfndescr>Width and height of the editor window.</div>
    <div class=dfn>TotalLines</div>
    <div class=dfndescr>Total number of lines in the edited text.</div>
    <div class=dfn>CurLine</div>
    <div class=dfndescr>Number of the current line.</div>
    <div class=dfn>CurPos</div>
    <div class=dfndescr>Cursor position in the current line.</div>
    <div class=dfn>CurTabPos</div>
    <div class=dfndescr>Cursor screen position in the current line. If the line does not contain tab characters, <i>CurTabPos</i> is equal to <i>CurPos</i>.</div>
    <div class=dfn>TopScreenLine</div>
    <div class=dfndescr>Number of the line at the top of the screen.</div>
    <div class=dfn>LeftPos</div>
    <div class=dfndescr>Position of the left border of the editor window in the edited text.</div>
    <div class=dfn>Overtype</div>
    <div class=dfndescr>Overtype mode state. 0 - insert mode, 1 - overtype mode.</div>
    <div class=dfn>BlockType</div>
    <div class=dfndescr>Type of the selected block. One of the following values (the <a name="EDITOR_BLOCK_TYPES">EDITOR_BLOCK_TYPES</a> enum):
        <table class="cont">
        <tr class="cont"><th class="cont" width="40%">Block type</th><th class="cont" width="60%">Description</th></tr>
        <tr class="cont"><td class="cont" width="40%"><a name="BTYPE_NONE">BTYPE_NONE</a></td>
        <td class="cont" width="60%">no selection, </td></tr>
        <tr class="cont"><td class="cont" width="40%"><a name="BTYPE_STREAM">BTYPE_STREAM</a></td>
        <td class="cont" width="60%">stream block</td></tr>
        <tr class="cont"><td class="cont" width="40%"><a name="BTYPE_COLUMN">BTYPE_COLUMN</a></td>
        <td class="cont" width="60%">column (rectangular) block.</td></tr>
        </table>
    </div>
    <div class=dfn>BlockStartLine</div>
    <div class=dfndescr>Number of the first line in the selected block.</div>
    <div class=dfn>AnsiMode</div>
    <div class=dfndescr>ANSI text mode state. This field is nonzero only when no character table is used and the text is in the ANSI codepage.</div>
    <div class=dfn>TableNum</div>
    <div class=dfndescr>Number of FAR character table currently used in the editor. -1 if no table is used and the text is in OEM format (in this case
      see AnsiMode). If this field is not -1, you can pass it to the
    <a href="../service_functions/chartable.html">CharTable</a> function to get the table.</div>

    <div class=dfn>Options</div>
    <div class=dfndescr>Describes the state of editor options.
      Can be a combination of the following flags (the <a name="EDITOR_OPTIONS">EDITOR_OPTIONS</a> enumeration):
<table class="cont">
<tr class="cont"><th class="cont" width="40%">Flag</th><th class="cont" width="60%">Description</th></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="EOPT_EXPANDTABS">EOPT_EXPANDTABS</a></td>
        <td class="cont" width="60%">The &quot;Expand all tabs to spaces&quot; option is selected.
          While editing a file convert all entered and existing Tab characters to the corresponding number
          of spaces.<br>
          This parameter can be changed using the
          <a href="../service_functions/editorcontrol.html#ECTL_SETPARAM">ECTL_SETPARAM</a> command
          (<a href="editorsetparameter.html#ESPT_EXPANDTABS">ESPT_EXPANDTABS</a>).
         </td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="EOPT_EXPANDONLYNEWTABS">EOPT_EXPANDONLYNEWTABS</a></td>
        <td class="cont" width="60%">The &quot;Expand newly entered tabs to spaces&quot; option is selected.
          While editing a file convert all newly entered Tab characters to the corresponding number
          of spaces. Existing Tab characters won't be converted.<br>
          This parameter can be changed using the
          <a href="../service_functions/editorcontrol.html#ECTL_SETPARAM">ECTL_SETPARAM</a>
          (<a href="editorsetparameter.html#ESPT_EXPANDTABS">ESPT_EXPANDTABS</a>).
         </td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="EOPT_PERSISTENTBLOCKS">EOPT_PERSISTENTBLOCKS</a></td>
        <td class="cont" width="60%">&quot;Persistent blocks&quot; option is on.</td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="EOPT_DELREMOVESBLOCKS">EOPT_DELREMOVESBLOCKS</a></td>
        <td class="cont" width="60%">&quot;Del removes blocks&quot; option is on.</td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="EOPT_AUTOINDENT">EOPT_AUTOINDENT</a></td>
        <td class="cont" width="60%">&quot;Auto indent&quot; option is on.
          This parameter can be changed using the
          <a href="../service_functions/editorcontrol.html#ECTL_SETPARAM">ECTL_SETPARAM</a> command.
        </td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="EOPT_AUTODETECTTABLE">EOPT_AUTODETECTTABLE</a></td>
        <td class="cont" width="60%">&quot;Autodetect character table&quot; option is on.</td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="EOPT_CURSORBEYONDEOL">EOPT_CURSORBEYONDEOL</a></td>
        <td class="cont" width="60%">&quot;Cursor beyond end of line&quot; option is on.
          This parameter can be changed using the
          <a href="../service_functions/editorcontrol.html#ECTL_SETPARAM">ECTL_SETPARAM</a> command.
        </td></tr>
        <tr class="cont"><td class="cont" width="40%"><a name="EOPT_SAVEFILEPOSITION">EOPT_SAVEFILEPOSITION</a></td>
        <td class="cont" width="60%">&quot;Save file position&quot; option is on.
          This parameter can be changed using the
          <a href="../service_functions/editorcontrol.html#ECTL_SETPARAM">ECTL_SETPARAM</a> command.
        </td></tr>
</table>
    </div>

    <div class=dfn>TabSize</div>
    <div class=dfndescr>Tab size.
      This parameter can be changed using the
      <a href="../service_functions/editorcontrol.html#ECTL_SETPARAM">ECTL_SETPARAM</a> command.
     </div>
    <div class=dfn>BookMarkCount</div>
    <div class=dfndescr>Number of editor bookmarks.
      To retrieve information about bookmarks, use the
      <a href="../service_functions/editorcontrol.html#ECTL_GETBOOKMARKS">ECTL_GETBOOKMARKS</a> command.
     </div>
    <div class=dfn>CurState</div>
    <div class=dfndescr>Current state of the text in the editor. Can contain
     one or more of the following flags (the <a name="EDITOR_CURRENTSTATE">EDITOR_CURRENTSTATE</a> enumeration):
<table class="cont">
<tr class="cont"><th class="cont" width="40%">Flag</th><th class="cont" width="60%">Description</th></tr>
       <tr class="cont"><td class="cont" width="40%"><a name="ECSTATE_MODIFIED">ECSTATE_MODIFIED</a></td>
       <td class="cont" width="60%">modified</td></tr>
       <tr class="cont"><td class="cont" width="40%"><a name="ECSTATE_SAVED">ECSTATE_SAVED</a></td>
       <td class="cont" width="60%">saved</td></tr>
       <tr class="cont"><td class="cont" width="40%"><a name="ECSTATE_LOCKED">ECSTATE_LOCKED</a></td>
       <td class="cont" width="60%">locked (Ctrl-L)</td></tr>
</table>
    </div>
    <div class=dfn>Reserved</div>
    <div class=dfndescr>Reserved for future use.</div>

</div>

<h3>Remarks</h3>
<div class=descr>
  To determine current character set in the editor exactly, the following table can be used:
<pre class=code>                    EditorInfo.TableNum        EditorInfo.AnsiMode
DOS                          -1                         0
WIN                          -1                         1
Other                   Table number                    0
</pre>
  For "Other", the
  <a href="../service_functions/chartable.html">CharTable</a> function should be used to retrieve
  the character table name.
</div>

<div class=see>See also:</div><div class=seecont>
<a href="index.html">structures</a> |
<a href="../delphi/teditorinfo.html">TEditorInfo</a>
</div>
</body>
</html>